"""
使用三方库redis操作Redis数据库
"""
import redis

client = redis.Redis(host='47.104.31.138', port=5489, password='Luohao.618')
print(client.ping())
client.set('k1', 'v1', ex=60)
print(client.ttl('k1'))
client.set('k2', 'v2')
client.delete('list1')
client.rpush('list1', 10, 20, 30, 40, 50)
list1 = client.lrange('list1', 0, -1)
list1 = list(map(lambda x: int(x.decode()), list1))
print(list1)
